<style>
	table.form_table {
		width:100%;
		margin:auto;
		font-size:14px;
	}
	table.form_table tr td:first-child {
		text-align:left;
		vertical-align:top;
		padding-top:6px;
		width:40%;
	}
</style>
<?=form_open("user/edit_info/{$user->user_id}", 'id="user_info_form"');?>
<table class="form_table">
	<tr>
		<td>Username:</td>
		<td><?=form_input(array('type' => 'text', 'name' => 'user_name', 'value' => $user->user_name))?></td>
	</tr>
	<tr>
		<td>Email:</td>
		<td><?=form_input(array('type' => 'text', 'name' => 'user_email', 'value' => $user->user_email))?></td>
	</tr>
	<tr>
		<td>Password:</td>
		<td><?=form_input(array('type' => 'password', 'name' => 'user_password', 'value' => 'xxxxxxxx', 'id'=>'user_password'))?></td>
	</tr>
	<tr>
		<td>Confirm:</td>
		<td><?=form_input(array('type' => 'password', 'name' => 'confirm_password', 'value' => 'xxxxxxxx'))?></td>
	</tr>
</table>
<?=form_close();?>
<script>
	$(function(){
		$('#user_info_form').validate({
			rules: {
				user_email:{required:true,email:true},
				user_password: {required:true, minlength:8},
				confirm_password: {required:true,equalTo:'#user_password'}
			},
			submitHandler: function(form) {
	       	    $(form).ajaxSubmit(function(response) {
					$(form).parents('.ui-dialog-content').dialog('close');
				});
			}
		});
	});
</script>